AM_CXXFLAGS = -I./decode -I./decode/table -I./decode/descriptor -I/usr/include/libhdhomerun -I/usr/lib/libhdhomerun -I/opt/local/include -pthread -D__STDC_FORMAT_MACROS -std=gnu++11

lib_LTLIBRARIES = libdvbtee.la

libdvbtee_la_SOURCES = \
    atsctext.cpp \
    channels.cpp \
    curlhttpget.cpp \
    decode.cpp \
    demux.cpp \
    dvb-vb2.cpp \
    feed.cpp \
    functions.cpp \
    hdhr_tuner.cpp \
    hlsfeed.cpp \
    linuxtv_tuner.cpp \
    listen.cpp \
    log.cpp \
    output.cpp \
    parse.cpp \
    rbuf.cpp \
    stats.cpp \
    tune.cpp

EXTRA_DIST = \
    atsctext.h \
    channels.h \
    curlhttpget.h \
    decode.h \
    demux.h \
    dvb-vb2.h \
    feed.h \
    functions.h \
    hdhr_tuner.h \
    hlsfeed.h \
    linuxtv_tuner.h \
    listen.h \
    log.h \
    output.h \
    outputbase.h \
    parse.h \
    rbuf.h \
    stats.h \
    tune.h

DVBTEE_LIBRARY_VERSION=0:0:0

libdvbtee_la_LDFLAGS = -version-info $(DVBTEE_LIBRARY_VERSION)

library_includedir=$(includedir)/dvbtee
library_include_HEADERS = \
    atsctext.h \
    channels.h \
    curlhttpget.h \
    decode.h \
    demux.h \
    dvb-vb2.h \
    feed.h \
    functions.h \
    hdhr_tuner.h \
    hlsfeed.h \
    linuxtv_tuner.h \
    listen.h \
    log.h \
    output.h \
    outputbase.h \
    parse.h \
    rbuf.h \
    stats.h \
    tune.h

# enable the next two lines and disable the one following in order to use the old decoder
if OLDDECODER
libdvbtee_la_SOURCES += desc.cpp
AM_CXXFLAGS += -DOLD_DECODER=1
libdvbtee_la_LIBADD =
else !OLDDECODER
libdvbtee_la_LIBADD = -L./decode -ldvbtee_decode
endif !OLDDECODER

if DVBPSIBUILD
AM_CPPFLAGS = -I../usr/include/
libdvbtee_la_LIBADD += -L../usr/lib/ -ldvbpsi
endif DVBPSIBUILD

if BUILD_OS_IS_DARWIN
libdvbtee_la_LIBADD += -L/opt/local/lib -liconv
endif BUILD_OS_IS_DARWIN

if CYGWIN
libdvbtee_la_LIBADD += -liconv -lws2_32
endif CYGWIN

if MINGW
libdvbtee_la_LIBADD += -liconv -lws2_32
endif MINGW

if MSYS
libdvbtee_la_LIBADD += -liconv -lws2_32
endif MSYS
